package Demo3;

/**
 * @Author YuanYuan
 * @Date 2022/5/17
 * @Time 13:06
 */

abstract class Botany{
    protected String name;

    public Botany(String name) {
        this.name = name;
    }

    public abstract void photosynthesis();
}
interface Spicy{
    public abstract void Spicy();
}
interface Bitter{
    public abstract void Bitter();
}
interface Gorgeous{
    public abstract void Gorgeous();
}
interface Aloof{
    public abstract void Aloof();
}
interface Onvine{
    public abstract void Onvine();
}

class Pepper extends Botany implements Spicy,Onvine{


    public Pepper(String name) {
        super(name);
    }

    @Override
    public void photosynthesis() {
        System.out.println(name+"可以光合作用");
    }

    @Override
    public void Spicy() {
        System.out.println(name+"是辣的");
    }

    @Override
    public void Onvine() {
        System.out.println(name+"在藤上生长");
    }


}

class Balsampear extends Botany implements Bitter,Onvine{

    public Balsampear(String name) {
        super(name);
    }

    @Override
    public void photosynthesis() {
        System.out.println(name+"可以光合作用");
    }

    @Override
    public void Bitter() {
        System.out.println(name+"是苦的");
    }
    @Override
    public void Onvine() {
        System.out.println(name+"在藤上生长");
    }
}

class peony extends Botany implements Gorgeous{


    public peony(String name) {
        super(name);
    }

    @Override
    public void photosynthesis() {
        System.out.println(name+"可以光合作用");
    }

    @Override
    public void Gorgeous() {
        System.out.println(name+"是艳丽的");
    }
}
class Plumblossom extends Botany implements Aloof{

    public Plumblossom(String name) {
        super(name);
    }

    @Override
    public void photosynthesis() {
        System.out.println(name+"可以光合作用");
    }

    @Override
    public void Aloof() {
        System.out.println(name+"是孤傲的");
    }
}

public class Test {
    public static void spicy(Spicy spicy) {
        spicy.Spicy();
    }
    public static void bitter(Bitter bitter) {
        bitter.Bitter();
    }
    public static void gorgeous(Gorgeous gor) {
        gor.Gorgeous();
    }
    public static void aloof(Aloof aloof) {
        aloof.Aloof();
    }
    public static void onVine(Onvine onvine) {
        onvine.Onvine();
    }
    public static void main(String[] args) {

        spicy(new Pepper("辣椒"));
        bitter(new Balsampear("苦瓜"));
        onVine(new Pepper("辣椒"));
        onVine(new Balsampear("苦瓜"));
        gorgeous(new peony("牡丹"));
        aloof(new Plumblossom("梅花"));
    }
}
